<template>
	<view class="content">
		<view class="banner-box">
			<swiper :autoplay="true" :interval="2000" circular>
				<swiper-item>
					<view class="swiper-item">
						<image src="https://img.quanminyanxuan.com/other/7e947d03304f49daace57f11c50ef30e.jpg" mode="widthFix"></image>
					</view>
				</swiper-item>
				<swiper-item>
					<view class="swiper-item">
						<image src="https://img.quanminyanxuan.com/other/367805eebbc54effae9db6747c8258a4.jpg" mode="widthFix"></image>
					</view>
				</swiper-item>
				<swiper-item>
					<view class="swiper-item">
						<image src="https://img.quanminyanxuan.com/other/cb9c80c539794c068b9362fa51e5a13d.jpg" mode="widthFix"></image>
					</view>
				</swiper-item>
			</swiper>
		</view>
		<view class="account">
			<view class="info" @click="go('user-center')">
				<!-- <view class="img">
					<svg t="1661248765889" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="43372" width="30" height="30"><path d="M836.608 280.576c-65.024 0-118.272 53.248-118.272 118.272 0 10.752 1.536 20.992 4.096 31.232-14.336 10.24-26.624 15.872-35.328 15.872-1.024 0-2.048 0-3.584-0.512-12.288-12.8-37.376-40.96-67.584-100.352 29.696-28.16 46.592-67.584 46.592-109.056 0-82.944-67.584-150.528-150.528-150.528-82.944 0-150.528 67.584-150.528 150.528 0 41.472 16.896 80.896 46.592 109.056-29.696 59.392-54.784 87.04-66.56 99.84-1.536 0.512-3.072 0.512-4.608 0.512-9.216 0-20.992-5.632-34.816-15.872 2.56-10.24 4.096-20.48 4.096-31.232 0-65.024-53.248-118.272-118.272-118.272-65.024 0-118.272 53.248-118.272 118.272 0 55.808 40.448 104.448 94.72 115.712l59.392 256.512c-14.848 18.944-24.064 44.544-24.064 67.584 0 40.96 30.72 99.84 86.016 99.84l454.656 0c55.296 0 86.016-58.88 86.016-99.84 0-22.016-8.704-45.568-23.552-62.976l59.904-259.584c54.784-11.264 93.696-59.904 93.696-116.736C954.88 333.824 902.144 280.576 836.608 280.576zM828.928 496.128l-64.512 280.576c-1.536 6.144 0.512 12.8 5.12 16.896 12.288 11.264 19.456 28.16 19.456 44.544 0 25.6-19.968 64-50.176 64l-454.656 0c-30.208 0-50.176-38.4-50.176-64 0-17.408 8.192-37.376 20.48-50.176 4.096-4.608 6.144-10.752 4.608-16.384l-64.512-276.992c-1.536-7.68-8.192-13.312-15.872-13.824-41.984-3.584-74.752-39.936-74.752-81.92 0-45.568 36.864-82.432 82.432-82.432 45.568 0 82.432 36.864 82.432 82.432 0 10.752-2.048 20.992-6.144 30.72-3.072 7.168-1.024 15.36 5.12 20.48 25.088 20.992 47.616 31.744 67.584 31.744 7.168 0 13.824-1.536 19.968-4.096 3.072-1.024 5.632-2.56 8.192-5.12 14.848-15.872 45.568-49.152 81.408-124.416 3.584-7.68 1.536-16.896-5.12-22.016-27.648-22.016-44.032-54.784-44.032-90.112 0-63.488 51.712-114.688 114.688-114.688s114.688 51.712 114.688 114.688c0 35.328-15.872 68.608-44.032 90.112-6.656 5.12-8.704 14.336-5.12 22.016 32.256 67.072 59.904 101.376 83.456 125.44 2.56 2.56 6.144 4.608 9.728 5.12 5.12 1.536 10.752 2.56 16.384 2.56 19.968 0 43.008-10.752 68.096-32.256 6.144-5.12 8.192-13.312 5.12-20.48-4.096-9.728-6.144-19.968-6.144-30.72 0-45.568 36.864-82.432 82.432-82.432 45.568 0 82.432 37.376 82.432 83.456 0 43.008-32.256 78.848-74.24 82.944C837.12 483.328 830.464 488.96 828.928 496.128z" p-id="43373" fill="#cf192a"></path><path d="M364.544 690.688 311.808 547.328 271.36 547.328 348.16 747.52 380.928 747.52 457.728 547.328 417.28 547.328Z" p-id="43374" fill="#cf192a"></path><path d="M474.112 547.328l36.864 0 0 200.704-36.864 0 0-200.704Z" p-id="43375" fill="#cf192a"></path><path d="M510.464 487.936c-5.12-4.608-11.264-7.168-17.92-7.168-7.168 0-13.312 2.56-17.92 7.168-3.584 3.072-7.68 8.704-7.68 18.432 0 7.168 2.56 13.312 7.68 18.432 4.608 4.608 10.752 7.168 18.432 7.168 6.656 0 12.288-2.56 17.92-7.168 5.12-5.12 8.192-11.264 8.192-18.432C518.656 496.64 514.56 491.008 510.464 487.936z" p-id="43376" fill="#cf192a"></path><path d="M645.12 542.208c-23.552 0-43.008 8.192-57.344 24.064l0-18.944-35.84 0 0 271.872 36.864 0L588.8 727.552c14.336 16.896 33.792 25.088 57.344 25.088 28.16 0 51.2-10.752 68.096-32.768 14.336-19.456 21.504-43.52 21.504-72.192 0-29.184-7.168-53.76-22.016-73.216C696.832 552.96 673.792 542.208 645.12 542.208zM602.624 700.416c-9.728-12.8-14.848-29.696-14.848-50.176l0-4.096c0-20.992 4.608-37.888 13.824-50.176 9.728-13.824 23.04-20.48 40.448-20.48 18.432 0 32.256 6.656 41.984 20.48 8.704 12.8 13.312 30.208 13.312 51.712 0 21.504-4.608 38.912-13.312 51.2-10.24 13.312-24.064 19.968-42.496 19.968C625.152 719.36 612.352 713.216 602.624 700.416z" p-id="43377" fill="#cf192a"></path></svg>
				</view> -->
				<image src="https://img.quanminyanxuan.com/other/c8e605b5b144480facd39b74a85bec8d.png" mode="widthFix"></image>
				<view class="name">
					兑换余额
				</view>
				<view class="sum">
					<text>{{redPack}}</text>
					积分
					<uni-icons type="forward" size="12" color="#ccc" style="margin-right:2px;"></uni-icons>
				</view>
			</view>
			<view class="tips-box">
				<text class="label">提醒</text>
				<text class="txt">您的 {{redPack}}
				<!-- <text style="color: #FF162E;font-weight: bold;margin: 0 10rpx;">13750</text> -->
				 积分即将到期，避免失效请及时使用！</text>
			</view>
		</view>
		<list :dataList="productList" :countdown="true" ref="list" style="width: 100%;"></list>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				productList: []
			}
		},
		computed:{
			redPack(){
				return this.$store.state.shop.redPack
			}
		},
		onReachBottom(){			
			this.$refs.list.reachBottom();
		},
		onLoad() {
			this.getProductList()
		},
		methods: {
			go(str){
				uni.switchTab({
					url: "/pages/user/user"
				})
			},
			getProductList(){
				this.$api.productList({
					
				}).then(res=>{
					this.productList = res.data.list
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}
	.banner-box{
		width: 100%;
		height: 350rpx;
		swiper{
			width: 100%;
			height: 100%;
		}
		image{
			width: 100vw;
			height: 100%;
		}
	}
	.account{
		width: 95vw;
		margin: 0 auto;
		border-radius: 20rpx;
		padding: 20rpx;
		background: rgba(255, 255, 255, 1);
		box-shadow: 0 -2px 8px 0 rgba(0, 0, 0, .1);
		position: relative;
		top: -30rpx;
		box-sizing: border-box;
		.info{
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding-bottom: 30rpx;
			border-bottom: 1rpx solid #EDEDED;
			image{
				width: 88rpx;
				height: 88rpx;
				border-radius: 88rpx;
			}
			.name{
				flex: 1;
				margin: 0 20rpx;
			}
			.sum{
				display: flex;
				align-items: center;
				font-weight: bold;
				text{
					color: $theme-color;
					font-size: 38rpx;
					margin-right: 10rpx;
				}
			}
			.img{
				width: 60rpx;
				height: 60rpx;
				background-color: rgba(207, 25, 42,.3);
				border-radius: 60rpx;
			}
		}
		.tips-box{
			display: flex;
			align-items: center;
			font-size: $uni-font-size-sm;
			padding-top: 20rpx;
			.label{
				padding: 0 10rpx;
				color:$theme-color ;
				border: 1rpx solid $theme-color;
				border-radius: 8rpx;
				margin-right: 20rpx;
			}
			.txt{
				
			}
		}
	}
</style>
